#include <iostream>

using namespace std;

int main(){
    int a,b;
    cin >> a >> b;
    int res ;

    res = ((b-a ) +24 )%24;
    if(a == b) 
    printf("O JOGO DUROU 24 HORA(S)\n");
    else 
    printf("O JOGO DUROU %d HORA(S)\n", res);
        
}